package com.its.common.net.core.config;

import com.its.common.net.client.handler.ClientHandlerExecutor;
import com.its.common.net.core.BaseNetHandlerExecutor;
import com.its.common.net.server.handler.ServerHandlerExecutor;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @Author xiaxp
 * @Date 9/19/22 13:55
 * @Description
 */
@AutoConfigureBefore({ServerHandlerExecutor.class, ClientHandlerExecutor.class, BaseNetHandlerExecutor.class})
public class HandlerPoolAutoConfigure {

    public HandlerPoolAutoConfigure(){
        netHandlerThreadPoolConfig();
    }

    @Bean
    @ConfigurationProperties(prefix = "its.net.handler.pool")
    public NetHandlerThreadPoolConfig netHandlerThreadPoolConfig(){
        NetHandlerThreadPoolConfig config =  new NetHandlerThreadPoolConfig();
        return config;
    }
}
